/* GUI CONVERTED from rcvrf01.p (converter v1.75) Tue Apr 10 12:06:05 2001 */
/* rcvrf01.p - CONFIGURED VERIFICATION                                        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.5 $                                                         */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 8.6      LAST MODIFIED: 09/20/96  BY: TSI *K005*                 */
/* REVISION: 8.6      LAST MODIFIED: 04/10/97  BY: Verghese Kurien *K0B3*     */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00  BY: *N0KP* Mark Brown          */
/* $Revision: 1.5 $    BY: Jean Miller         DATE: 03/22/01  ECO: *P008*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}

/*INPUT PARAMETERS*/
define input parameter address as character no-undo.
define input parameter site as character no-undo.
define input parameter callpgm as character no-undo.

/*OUTPUT WORKFILES*/
define shared workfile wf_umsg_det no-undo
   field wf_umsg_site as character
   field wf_umsg_addr as character
   field wf_umsg_nbr as integer
   field wf_umsg_seq as integer
   field wf_umsg_level as integer
   field wf_umsg_exec_pgm as character.

/*LOCAL VARIABLES*/
define variable i as integer no-undo.
define variable j as integer no-undo.

for each wf_umsg_det exclusive-lock:
   delete wf_umsg_det.
end.

assign
   callpgm = substring(callpgm,r-index(callpgm,"/") + 1)
   callpgm = substring(callpgm,r-index(callpgm,"~\") + 1).

do i = 1 to num-entries(site):

   do j = 1 to num-entries(address):

      if entry(i,site) = "" and i <> 1 then
         next.

      if entry(j,address) = "" and j <> 1 then
         next.

      for each umsg_det
         where umsg_lang     = global_user_lang
           and umsg_site     = entry(i,site)
           and umsg_addr     = entry(j,address)
           and umsg_call_pgm = callpgm
           and umsg_level     > 0
      no-lock:

         find first wf_umsg_det
              where wf_umsg_nbr = umsg_nbr
                and wf_umsg_seq = umsg_seq
         exclusive-lock no-error.

         if not available wf_umsg_det then
            create wf_umsg_det.

         assign
            wf_umsg_site     = umsg_site
            wf_umsg_addr     = umsg_addr
            wf_umsg_nbr      = umsg_nbr
            wf_umsg_seq      = umsg_seq
            wf_umsg_level    = umsg_level
            wf_umsg_exec_pgm = umsg_exec_pgm.

      end. /* for each umsg_det */

   end. /* do j = 1 to */

end. /* do i = 1 to */
